'use strict';
const dayjs = require("dayjs");
const {getDefaultModelConfig} = require("../../utils/common");

module.exports = app => {
    const { STRING, INTEGER, DATE, TINYINT, TEXT } = app.Sequelize;
    return app.model.define(
        'Point',
        {
            id: {type: INTEGER, primaryKey: true, autoIncrement: true},
            name: STRING(255),
            latitude: STRING(255),
            longitude: STRING(255),
            content: TEXT,
            icon: TEXT,
            ...getDefaultModelConfig(app)
        },
        {
            tableName: 'point',
            timestamps: true,
            createdAt: 'create_time',
            updatedAt: 'update_time'
        }
    );
};
